package com.qfedu.service.impl;

import com.qfedu.bean.User;
import com.qfedu.dao.UserDao;
import com.qfedu.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author:zhengyilong
 * @email:1797344574@qq.com
 * @phone:13479394730
 * @desc:
 * @DateTime:2022/5/13 14:54
 **/
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    public User checkLogin(String userName, String userPwd) {
        User user = userDao.QueryUserByName(userName);
        //加密省略
        if (user == null){
            return null;
        }
        if (user.getUserPwd().equals(userPwd)){
            return user;
        }else {
            return null;
        }
    }
}

